package String1;

import java.util.Arrays;

/**
 * \* Created with IntelliJ IDEA.
 * \* User: Administrator
 * \* Date: 2021/11/18
 * \* Time: 21:46
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class TestDemo {



    public static void func(String s,char[] array){
        s="zhujianhui";
        array[0]='p';
    }

    public static void main3(String[] args) {
        String str="abcedf";
        char[] chars={'b','i','t'};
        func(str,chars);
        System.out.println(str);
        System.out.println(Arrays.toString(chars));
    }

    public static void main2(String[] args) {
        String str="abcdef";
        String str2=str;
        System.out.println(str);
        System.out.println(str2);
        str="bit";
        System.out.println("=================");
        System.out.println(str);
        System.out.println(str2);
    }

    public static void main1(String[] args) {
        String str="abcdef";
        //调用构造方法进行构造
        String str2=new String("hello");

        char[] chars={'a','b','c'};
        String str3=new String(chars);
        System.out.println(str3);
    }
}
